  /**
 * Base Controller
 */

 export default class BaseConterller{

	/**
	 * [constructor 构造函数]
	 */
	constructor(router) {
	
		// if(!router) return;
		// // List
		// router.route('/').get(this.SelectPage).post(this.Add);
		// router.route('/:id')
		// 	// All
		// 	.all((req, res, next) => {
		// 		const method = req.params.method;
		// 		if(method === 'put') this.UpdateById(req, res, next);
		// 		else if(method === 'delete') this.DeleteById(req, res, next);
		// 		else next();
		// 	})
		// 	// View
		// 	.get(this.selectById)
		// 	// Update
		// 	.put(this.UpdateById)
		// 	// Delete
		// 	.delete(this.DeleteById)
	}

	set service(val) {
		this._Serv = val;
		return this;
	}

	get service() {
		return this._Serv;
	}
	Add(req, res, next) {
		return this.service.Add(params);
	}

	UpdateById(req, res, next) {
		return this.service.UpdateById(params);
	}

	DeleteById(req, res, next) {
		return this.service.DeleteById(id)
	}

	selectById(req, res, next) {
		return this.service.selectById(id)
	}

	Search(req, res, next) {
		return this.service.Search(params)
	}

	Count(req, res, next) {
		return this.service.Count(params)
	}

	SelectPage(req, res, next) {
		
		let list = this.service.SelectPage();
		res.send('23456789');
		//return this.service.selectPage(params, page, size);
	}
}

